import { getConfig } from '@/api/my.js'
export default {
	data() {
		return {
			userInfo: uni.getStorageSync('userInfo'),
			withdraw_explain: '',
			showRule: false,
			content: '',
			navList: [{
				icon: '/static/img/my/bambooLeaf/nav1.png',
				name: '充值',
				url: './recharge'
			},
			{
				icon: '/static/img/my/bambooLeaf/nav3.png',
				name: '明细',
				url: './record',
			}],

			menuList: [{
				icon: '/static/img/my/bambooLeaf/menu1.png',
				name: '小竹叶充值',
				url: './recharge'
			},
				// {
				// icon: '/static/img/my/bambooLeaf/menu2.png',
				// name: '每日签到',
				// url: '../signIn/index',
				// // handler: ''
				// },
				{
				id: 3,
				icon: '/static/img/my/bambooLeaf/menu3.png',
				name: '小竹问答问题解答',
				url: '/pages/exchange/index/index',
			}, {
				icon: '/static/img/my/bambooLeaf/menu4.png',
				name: '邀请好友',
				url: '../Invite/index',
			}],
		};
	},
	onLoad(e) {
		this.getConfigs()
	},
	methods: {
		leftClick() {
			uni.navigateBack()
		},
		// 获取小竹叶规则
		getConfigs() {
			getConfig({ name: this.withdraw_explain }).then(res => {
				if (res.code == 1) {
					this.content = res.data.withdraw_explain
				} else {
					this.$used.msg(msg)
				}
			})
		},

		// 点击菜单
		clickMenu(item) {
			if (item.handler) this[item.handler]()
			else if (item.url) {
				if (item.id == 3) {
					this.$used.href(item.url, {
						type: 4
					})
					uni.setStorageSync('navTodnlz', true)
				} else {
					this.$used.href(item.url)
				}
			}
		},
	},
}